﻿<!doctype html>
<html>
<head>
    <title>SpreadJS - Fixed Position</title>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />

    <link href="../../../external/spreadjs/css/gcspread.sheets.excel2013white.9.40.20161.0.css" rel="stylesheet" type="text/css" />

    <script src="../../../external/external/jquery-1.8.2.min.js" type="text/javascript"></script>

    <script type="text/javascript" src="../../../external/spreadjs/gcspread.sheets.all.9.40.20161.0.min.js"></script>

    <script id="scriptInit" type="text/javascript">
        /*code_begin*/
        $(document).ready(function () {
            var spread = new GcSpread.Sheets.Spread(document.getElementById("ss"));
            initSpread(spread);
        });

        function initSpread(spread) {
            var sheet = spread.getSheet(0);
            sheet.setColumnWidth(0, 20);

            var content1 = document.createElement("div");
            content1.style.backgroundColor = "gray";
            content1.style.width = "100%";
            content1.style.height = "100%";
            content1.innerHTML = "Floating objects at fixed position.";
            var customFloatingObject1 = new GcSpread.Sheets.CustomFloatingObject("customFloatingObject1", 20, 20, 240, 20);
            customFloatingObject1.Content(content1);
            customFloatingObject1.fixedPosition(true);
            sheet.addFloatingObject(customFloatingObject1);

            var picture1 = sheet.addPicture("picture1", "images/apple.jpg", 1, 5);
            picture1.fixedPosition(true);

            var content2 = document.createElement("div");
            content2.style.backgroundColor = "lightgray";
            content2.style.width = "100%";
            content2.style.height = "100%";
            content2.innerHTML = "Normal floating objects.";
            var customFloatingObject2 = new GcSpread.Sheets.CustomFloatingObject("customFloatingObject2", 20, 280, 240, 20);
            customFloatingObject2.Content(content2);
            sheet.addFloatingObject(customFloatingObject2);

            var picture2 = sheet.addPicture("picture2", "images/logo.png", 14, 5);
            picture2.backColor("black");
        };
        /*code_end*/
    </script>

</head>
<body>
    <div class="sample-turtorial">
        <div id="ss" style="width: 100%; height: 520px; border: 1px solid gray;"></div>
    </div>
</body>
</html>
